﻿<UserControl x:Class="OI.Views.CategoryView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <TextBlock Name="Header" Grid.Row="0" Style="{StaticResource SectionHeaders}"/>
        
        <ItemsControl Name="Items" Grid.Row="1">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <RadioButton Width="240" Height="20" GroupName="Categories"
                            Style="{StaticResource CatalogListRadioButton}"
                            Micro:Message.Attach="Select($dataContext); [Event Loaded] = [Action ItemLoaded($dataContext, $source)]" >
                        <RadioButton.Content>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="{Binding Name}"
                                           HorizontalAlignment="Left"
                                           TextWrapping="Wrap"
                                           Style="{StaticResource ListItems}"
                                           Width="300"/>
                            </StackPanel>
                        </RadioButton.Content>
                    </RadioButton>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</UserControl>
